package data;

import com.EntityName;
import com.google.appengine.api.datastore.Entity;

public class POSGuest extends AbstractData{
	private long id= -1;
	private long hotelId;
	private String Name;
	private String phoneNumber;
	
	public POSGuest()
	{

	}
	public POSGuest(long id){
		this.id = id;
	}
	public long getId() {
		return id;
	}
	public void setId(long id) {
		this.id = id;
	}
	public long getHotelId() {
		return hotelId;
	}
	public void setHotelId(long hotelId) {
		this.hotelId = hotelId;
	}
	public String getName() {
		return Name;
	}
	public void setName(String name) {
		Name = name;
	}
	public String getPhoneNumber() {
		return phoneNumber;
	}
	public void setPhoneNumber(String phoneNumber) {
		this.phoneNumber = phoneNumber;
	}
	
	@Override
	public Entity getEntity() {
		Entity item;
		if(this.key == null)
			item = new Entity(EntityName.POSGuest);
		else
			item = new Entity(this.key);
			item.setProperty("hotelId", this.hotelId);
			item.setProperty("Name", this.Name);
			item.setProperty("phoneNumber", this.phoneNumber);
			return item;
	}
	@Override
	public void setEntity(Entity entity) {
		this.id = entity.getKey().getId();
		this.hotelId = (Long) entity.getProperty("hotelId");
		this.Name = (String) entity.getProperty("Name");
		this.phoneNumber = (String) entity.getProperty("phoneNumber");
		this.key = entity.getKey();
	}
	
	public void LoadData() {
		if (this.id > -1) {
			Entity entity = LoadData(EntityName.POSGuest, this.id);
			setEntity(entity);
		}
	}
	
	
}
